#ifndef LOGINDIALOG_H
#define LOGINDIALOG_H

#include <QDialog>
#include <QMessageBox>
#include <accountmanage.h>
#include "mainwindow.h"

namespace Ui {
    class LoginDialog;
}

class ClickAbleLabel:public QLabel
{
	Q_OBJECT
public:
	ClickAbleLabel(QWidget* parent = 0);

protected:
	int MyLabelPressed;
	void mousePressEvent(QMouseEvent *e);
	void mouseReleaseEvent(QMouseEvent *e);
	void mouseMoveEvent(QMouseEvent *e);

signals:
	void clicked();
};

class LoginDialog : public QDialog {
    Q_OBJECT
public:
    LoginDialog(QWidget *parent = 0);
    ~LoginDialog();

protected:
    void changeEvent(QEvent *e);
	void closeEvent(QCloseEvent *);

private:
    Ui::LoginDialog *ui;
	AccountManage* m_accountManage;
	MainWindow *mainWindow;
	ClickAbleLabel* modifyPassword;
        bool isVisible;

	void setupSignals();
	void setupWidgets();

private slots:
	void onLogin();
	void onModifyPassword();
	void onExit();
	void onCancelModify();
	void onOkForModify();

signals:
	void loginSuccess();
	void exitSystem();
};





#endif // LOGINDIALOG_H
